package com.cy.springbootemep.handlerException;

import com.cy.springbootemep.util.JsonResult;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class GlobalExceptiom {
    @ExceptionHandler(RuntimeException.class)
    public JsonResult doRuntimeException(RuntimeException e) {
        return new JsonResult(0, e.getMessage());
    }
}
